package com.run.merchant.service.impl;

import java.util.List;
import com.run.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.run.merchant.mapper.RunNoticeMapper;
import com.run.merchant.domain.RunNotice;
import com.run.merchant.service.IRunNoticeService;

/**
 * 公告信息Service业务层处理
 * 
 * @author run
 * @date 2025-05-20
 */
@Service
public class RunNoticeServiceImpl implements IRunNoticeService 
{
    @Autowired
    private RunNoticeMapper runNoticeMapper;

    /**
     * 查询公告信息
     * 
     * @param noticeId 公告信息主键
     * @return 公告信息
     */
    @Override
    public RunNotice selectRunNoticeByNoticeId(Long noticeId)
    {
        return runNoticeMapper.selectRunNoticeByNoticeId(noticeId);
    }

    /**
     * 查询公告信息列表
     * 
     * @param runNotice 公告信息
     * @return 公告信息
     */
    @Override
    public List<RunNotice> selectRunNoticeList(RunNotice runNotice)
    {
        return runNoticeMapper.selectRunNoticeList(runNotice);
    }

    /**
     * 新增公告信息
     * 
     * @param runNotice 公告信息
     * @return 结果
     */
    @Override
    public int insertRunNotice(RunNotice runNotice)
    {
        runNotice.setCreateTime(DateUtils.getNowDate());
        return runNoticeMapper.insertRunNotice(runNotice);
    }

    /**
     * 修改公告信息
     * 
     * @param runNotice 公告信息
     * @return 结果
     */
    @Override
    public int updateRunNotice(RunNotice runNotice)
    {
        return runNoticeMapper.updateRunNotice(runNotice);
    }

    /**
     * 批量删除公告信息
     * 
     * @param noticeIds 需要删除的公告信息主键
     * @return 结果
     */
    @Override
    public int deleteRunNoticeByNoticeIds(Long[] noticeIds)
    {
        return runNoticeMapper.deleteRunNoticeByNoticeIds(noticeIds);
    }

    /**
     * 删除公告信息信息
     * 
     * @param noticeId 公告信息主键
     * @return 结果
     */
    @Override
    public int deleteRunNoticeByNoticeId(Long noticeId)
    {
        return runNoticeMapper.deleteRunNoticeByNoticeId(noticeId);
    }
}
